home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Sapphire Collection
/
Software Vault (Sapphire Collection) (Digital Impact).ISO
/
cdr08
/
finst152.zip
/
INSTALLR.H_
/
INSTALLR.H
Wrap
C/C++ Source or Header
|
1994-07-30
|
8KB
|
205 lines
#define __INSTALLR_H
#ifndef __TIMER_H
#include "timer.h"
#endif
#ifndef __STDLIB_H
#include "stdlib.h"
#endif
#ifndef __WINDOWS_H
#include "windows.h"
#endif
struct version /* version info of a file */
{
UINT lang; /* language id */
UINT cset; /* character set */
DWORD os; /* os */
DWORD prmtype; /* primary type (exe, dll, etc) */
DWORD subtype; /* sub type (display, keyboard, etc) */
DWORD verhi32; /* high 32bit version no */
DWORD verlo32; /* low 32bit version no */
};
class copymonitor /* copy monitor */
{
public:
virtual int getblksize() = 0;
virtual int notify(LONG nobytesread) = 0;
};
class voidcopymonitor:public copymonitor /* copy monitor which does nothing */
{
public:
int getblksize()
{
return 0; /* return 0 means copy the whole file, no blocking is required */
}
int notify(LONG nobytesread)
{
return 1; /* always succeed */
}
};
class pmconv;
class oprdr;
class voidrdr;
class simpledde;
struct pmiteminfo;
class installer /* name space for installation routines */
{
int isrunpm; /* did we start PM in order to DDE with it? */
int issupressmsg; /* should error msg be supressed? */
char dirw[_MAX_PATH]; /* Windows dir */
char diry[_MAX_PATH]; /* Windows system dir */
char dirs[_MAX_PATH]; /* install source dir */
HWND owner; /* owner of dialogs */
HWND msgdlg; /* message dlg */
HWND oldowner; /* original owner of dialogs before the msgdlg */
oprdr *rdr; /* recorder to record all operations (for uninstall) */
pmconv *c; /* conversation with program manager */
FARPROC p; /* procedure instance the message dlg */
simpledde *d; /* dde wrapper */
HINSTANCE inst;
public:
installer(); /* set bufs to empty */
~installer(); /* del bufs */
char *getdirw() { return dirw; }
char *getdiry() { return diry; }
char *getdirs() { return dirs; }
HWND getowner() { return owner; }
HWND getmsgdlg() { return msgdlg; }
static voidrdr vrdr; /* a op recorder that does nothing */
static voidcopymonitor vcm; /* a copy monitor that does nothing */
int copy(int srch, int dsth, copymonitor &cm);
int copy(char srcpath[], char dstpath[], int ischkver = 0, int isshared = 0, int iscompressed = 0, copymonitor &cm = vcm);
int deldir(char dir[]);
int multideldir(char dir[]);
int delfile(char dir[], char file[]);
int delfile(char path[]);
int renfile(char path[]);
int renfile(char oldpath[], char newpath[]);
int setfileattrib(char path[], UINT newflags);
int delinisect(char file[], char sect[]);
int addinisect(char file[], char sect[]);
int insinientry(char file[], char sect[], char entry[], char value[], int seqno = 0);
int addinientry(char file[], char sect[], char entry[], char value[]);
int delinientry(char file[], char sect[], char entry[], int seqno = 0);
int setinivalue(char file[], char sect[], char entry[], char value[], int seqno = 0);
int askdir(char dir[], char prompt[]);
int askquitinstall();
int askquitllatsni();
int askretry(char msg[]);
int askdrive(int *driveno, char prompt[]);
int askinsertdisk(char diskdesc[]);
int askoverwrite(char srcpath[], version &srcv, char dstpath[], version &dstv);
int msgbox(char txt[], char title[], UINT flags);
int msgbox(char txt[], char title[], HICON icon, char *buttontxts[]);
int msgbox(char txt[], char title[], char icon[], char *buttontxts[]);
int begddepm();
int runpm();
int endpm();
int execwait(char path[], int showcmd);
int getversion(char path[], version *v);
int addgrup(char grup[]);
int delgrup(char grup[]);
int additem(char grup[], char item[], char cmdl[], char icon[], int iidx = 0);
int additem(char grup[], pmiteminfo &pmii);
int delitem(char grup[], char item[]);
int getfreespace(int drive, double *f);
int chkfreespace(int drive, double minf);
int chkdiroccupied(char dir[]);
int chkgrupoccupied(char grup[]);
int chkexistdir(char path[]);
int chkexistdrive(char path[]);
int compareversion(char srcpath[], char dstpath[]);
int mkdir(char dir[]);
int multimkdir(char dir[]);
int forceexist(char diskdesc[], char path[]);
int setsupressmsg(int b);
int setregkey(char kpath[], char value[]);
int addregkey(char kpath[]);
int delregkey(char kpath[]);
int getregkey(char kpath[], char value[]);
int getnosubkeys(char kpath[]);
int chkexistregkey(char kpath[]);
int chkregkeyoccupied(char kpath[]);
int assertinddepm();
void init(HINSTANCE inst, HWND owner);
void attachrdr(oprdr &rdr);
void begmsgdlg(char txt[], char title[]);
void endmsgdlg();
void peekdispatchmsg();
void endddepm(int isendpm);
void mergedf(char path[], char d[], char f[]);
void getdfrompath(char path[], char d[]);
void getffrompath(char path[], char f[]);
void outofmem();
void error(char msg[], ...);
void errordel(char path[]);
void errorren(char oldpath[], char newpath[]);
void errorread(char path[]);
void errorcopy(char srcpath[], char dstpath[]);
void errorexec(char name[]);
void errormkdir(char dir[]);
void errorwrite(char path[]);
void errorshare(char path[]);
void errorcreate(char path[]);
void erroraccess(char path[]);
void errornofile(char path[]);
void errorbadpath(char path[]);
void errordelitem(char name[]);
void errordelgrup(char name[]);
void erroradditem(char name[]);
void erroraddgrup(char name[]);
void errorshowgrup(char name[]);
void errorfileinuse(char path[]);
void erroropenregkey(char path[]);
void errorreadverinfo();
void changingcolor(HDC dc, RECT r1, RECT r2, COLORREF cs[], int blkw, int blkh);
LONG getfilesize(char path[]);
HWND findpmmainwnd();
HWND setowner(HWND owner);
oprdr &detachrdr();
};
class pmddekeeper
{
int isendpm;
installer &ir;
public:
pmddekeeper(int *r, installer &irx, int isendpmx):ir(irx)
{
isendpm = isendpmx;
*r = ir.begddepm(); /* begin DDE */
}
~pmddekeeper()
{
ir.endddepm(isendpm);
}
};
class msgdlgkeeper
{
timer tm;
installer &ir;
public:
msgdlgkeeper(installer &ir, char msg[], char title[], DWORD deltime);
~msgdlgkeeper();
void peekdispatchmsg();
};